Skip to content

feat(symbols,watch): Stage 3 — tree-sitter WASM symbols, per-symbol chunks, watchRoots, structured search - #13

Merged
thatswiftdev merged 1 commit into
mainfrom
wt/xerj-stage3
Oct 21, 2026
Merged

thatswiftdev merged 1 commit into
mainfrom
wt/xerj-stage3

Conversation

@thatswiftdev

Copy link
Copy Markdown
Contributor

What (Lionidas Stage 3 Part A — mechanism only, no Lionidas words)

  1. tree-sitter WASM extraction — extractSymbolsTree/symbolsFor over swift/typescript/tsx/js/python; grammar policy is caller-supplied (SymbolGrammars, ext → pack name OR absolute .wasm path); defaultSymbolGrammars() preset; v1 regex fallback preserved.
    ⚠️ Vendored grammars/tree-sitter-swift.wasm (from tree-sitter-wasms@0.1.8): the pack swift ≥ 0.1.10 is process-fatal on Node ≥ 24 — Fatal process out of memory: Zone in V8 turboshaft background wasm tier-up (parse succeeds, process dies later; --liftoff-only avoids it but is banned in NODE_OPTIONS). Isolated empirically: only swift affected, 0.1.8 clean. Full story + re-extract instructions in grammars/README.md.
  2. Per-symbol chunks (F1) — NormalizedDocument.chunks? passthrough, ingest stores verbatim; repoConnector now emits one chunk per symbol (heading_path: "symbol: <name> (<kind>)"), doc content stays a browsable summary.
  3. repoDocumentFor(cfg, absPath) (F3) — per-file normalize honoring skip rules; freshness watcher path re-ingests one file, no walk.
  4. watchRoots — debounced changed-path batches, one OS watch per root, ignore policy, healthy()/describe(); errors mark the root dead, never throw.
  5. EsCompatRetriever.search({query, headingPrefix?, size}) (F2) — BM25 + heading_path prefix filter; same throw contract as retrieve().

Verify

  • tsc 0 errors; suite 226 passed / 39 files (WASM tests run WITHOUT --liftoff-only, proving the vendored swift is clean in-process)
  • extraction fixtures per language; chunks passthrough idempotence; watcher real-fs-event tests; structured search against a fake endpoint
  • boundary allowlist: web-tree-sitter + node:module added (declared deps)

Consumer wiring (Lionidas) pins this PR sha and follows after merge.

…l chunks, watchRoots, structured search

- extractSymbolsTree/symbolsFor: swift/ts/tsx/js/py via web-tree-sitter@0.25.4
  + tree-sitter-wasms pack; caller-owned grammar map; regex fallback unchanged.
  Vendored 0.1.8 swift wasm — pack swift >= 0.1.10 is process-fatal on Node 24
  (V8 turboshaft Zone OOM in background tier-up; details in grammars/README.md).
- NormalizedDocument.chunks? passthrough (F1): pre-chunked docs stored verbatim;
  repoConnector emits one chunk per symbol (heading_path "symbol: name (kind)").
- repoDocumentFor (F3): per-file normalize for watcher batches, same skip rules.
- watchRoots: debounced batches, one OS watch per root, ignore policy, healthy().
- EsCompatRetriever.search (F2): BM25 + heading_path prefix filter, throws on error.
- Suite 226 passed (WASM tests run WITHOUT --liftoff-only — vendored swift clean). v0.8.0
@thatswiftdev
thatswiftdev merged commit 40a0328 into main Oct 21, 2026
1 check passed
@thatswiftdev
thatswiftdev deleted the wt/xerj-stage3 branch October 21, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant